const express = require('express');
const https = require('https');
const fs = require('fs');
const path = require('path');
const ejs = require('ejs');
const io = require('socket.io')();

//同步读取密钥和签名证书
const options = {
    key:fs.readFileSync(path.resolve(__dirname,'../ssl/ca.key'), 'utf8'),
    cert:fs.readFileSync(path.resolve(__dirname,'../ssl/server.crt'), 'utf8')
}

const app = express();

app.use('/public',express.static('public'));


app.set('views',path.resolve(__dirname,'../views/'));
app.engine('.html', ejs.__express);
app.set('view engine', 'html');

app.get('/test',function(req,res,next){
    console.log(req)
    res.send(options);
});

app.get('/',function(req,res,next){
    res.render('Amap',{});
});

app.use("/",require("./mock")(app))

app.listen(3000);

